package com.bangbang.config;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.ParseException;
import java.time.LocalDateTime;

@Component
@Configurable
@EnableScheduling
public class EasyQuartz {



    @Scheduled(cron = "0/5 * * * * *")
    public void reportCurrentByCron() throws ParseException {
        System.err.println("执行业务");
        //执行发送感谢邮件
        //查询当前日推迟一个月的时间
        LocalDateTime now = LocalDateTime.now();
        String s1 = now.getYear() + "-" + (now.getMonthValue() - 1) + "-" + now.getDayOfMonth();
        String s2 = now.getYear() + "-" + (now.getMonthValue() - 1) + "-" + (now.getDayOfMonth()+1);

    }
}
